package com.zengqingfa.springboot.redis.delay;

import com.zengqingfa.springboot.redis.delay.entity.Message;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @author zengqingfa
 * @className OrderRedisDelayQueue
 * @description
 * @create 2022/9/24 17:03
 */
@Component
@Slf4j
class MessageRedisDelayQueue extends AbstractRedisDelayQueue<Message> {

    @Override
    protected String getDelayTaskName() {
        return DelayQueueConstant.DELAY_QUEUE_MESSAGE;
    }

    @Override
    public void execute(DelayTask delayTask) {
        //TODO 执行短信相关的业务逻辑
        for (int i = 0; i < 10; i++) {
            Message message = (Message) delayTask.getMsg();
            log.info("短信队列：{},{}", i,message);
        }
    }
}
